import 'package:flutter/material.dart';

/// Created by XieXin on 2020/3/16.
/// 线条
class XLine {
  ///水平分割线
  static const Widget line = Divider();

  static Widget getDivider(
    context, {
    double height = 1,
    double indent = 0,
    double endIndent = 0,
    Color? color,
  }) {
    color = color ?? Theme.of(context).dividerColor;
    return Divider(
      height: height,
      thickness: height,
      color: color,
      indent: indent,
      endIndent: endIndent,
    );
  }

  static Widget getVerticalDivider(
    context,
    double height, {
    double width = 1,
    Color? color,
  }) {
    width = width;
    color = color ?? Theme.of(context).dividerColor;
    return SizedBox(
      width: width,
      height: height,
      child: VerticalDivider(
        color: color,
        width: width,
        thickness: width,
      ),
    );
  }
}
